package org.example.dao.impl;

import org.example.dao.UserDao;
import org.example.entity.User;

import java.util.ArrayList;
import java.util.List;

public class UserDaoImpl implements UserDao {
    public User getUserName(String name){
        String sql = "SELECT * FROM db_user WHERE user_name = ?;";
        List<User> list = DBUtil.executeQuery(User::map,sql,name);
        if(list.size()>0){
            return list.get(0);
        }
        return null;
    }
}